Run the following cell to send some data to your Message Hub instance.

The send_message.py script below uses the credentials you saved in Step 1 in the file vcap.json to communicate with your Message Hub instance.


In [9]:
%%bash

# we use the kafka python library for sending test messages
# check that it is available.  if it isn't available, install it
python -c 'import kafka' || pip install kafka-python --user

# send the test message '123'
python ./SparkMessageHubScala/send_message.py 123


('topic', u'mytopic')
('partition', 0)
('offset', 30)